#!/bin/sh


fun()
{
    var1="abc"
    local var2="bcd"
}


#main

fun
echo "var1=$var1"
echo "var2=$var2"
(var1="eee")
(echo $var1)
echo "var1=$var1"

